package exam;

import java.util.Arrays;
import java.util.LinkedList;
import java.util.Queue;
import java.util.Scanner;

public class day3 {

    public static void main(String[] args) {
        Scanner scanner=new Scanner(System.in);
        int n=scanner.nextInt();
        int x=scanner.nextInt();
        int []arr=new int[n];
        int sum=0;
        int left=0;
        int right=0;
      int minlen=Integer.MAX_VALUE;
        int l=0;
        for (int i = 0; i <n ;) {

            if(sum>=x){
                int len=i-l+1;
                if(len<minlen){
                    minlen=len;
                    left=l;
                    right=i;
                }
                sum-=arr[l++];
            }else {
                arr[i]= scanner.nextInt();
                sum+=arr[i++];
            }
        }
        left++;
        System.out.println(left+" "+right);
    }




    public static void main5(String[] args) {
        Scanner scanner=new Scanner(System.in);
        int x=scanner.nextInt();
        int n=scanner.nextInt();
        int []arr=new int[x];
        for (int i = 0; i <x ; i++) {
            arr[i]=scanner.nextInt();
        }
        for (int i = 0; i <n ; i++) {
            Arrays.sort(arr);
            int j= arr.length-1;
            while (arr[j]%2!=0&&j>=0){
                j--;
            }
            arr[j]/=2;
        }
        int sum=0;
        for (int i = 0; i < arr.length ; i++) {
            sum+=arr[i];
        }
        System.out.println(sum);
    }

    public static void main7(String[] args) {
        Scanner scanner=new Scanner(System.in);
        int n=scanner.nextInt();
        int x=scanner.nextInt();
        int []arr=new int[n];
        int sum=0;
        int minleft=0;
        int minright=0;
        int l=0;
        int minlen=Integer.MAX_VALUE;
        for (int i = 0; i <n ; i++) {
            arr[i]=scanner.nextInt();
            sum+=arr[i];
            while(sum>=x){
                int len=i-l+1;
                if (len<minlen){
                    minlen=len;
                    minleft=l;
                    minright=i;
                }
                    sum-=arr[l++];
            }
        }
        minleft++;
        minright++;
        System.out.println(minleft+" "+minright);
    }


    public static void main6(String[] args) {
        Scanner scanner=new Scanner(System.in);
        int n=scanner.nextInt();
        int x=scanner.nextInt();
        int []arr=new int[n];

        int sum=0;
        for (int i = 0; i <n ; i++) {
            arr[i]=scanner.nextInt();
            sum+=arr[i];
        }
        int l=0;
        int r=arr.length-1;
        while(sum>=x){
            if (sum-arr[r]>=x){
                sum-=arr[r--];
            } else if (sum-arr[l]>=x) {
                sum-=arr[l++];
            }else {
               break;
            }
        }
        r++;
        l++;
        System.out.println(l+" "+r);
    }



    public static void main3(String[] args) {
        Scanner scanner=new Scanner(System.in);
        int n=scanner.nextInt();
        int x=scanner.nextInt();
        int l=0;
        int r=-1;
        int l1=0;
        int sum=0;
        int minlen=Integer.MAX_VALUE;
     Queue<Integer>queue=new LinkedList<>();
        for (int i = 1; i <=n ; i++) {
            int t=scanner.nextInt();
            queue.add(t);
            sum+=t;
            while (sum>=x){
                if(queue.size()<minlen){
                    minlen= queue.size();
                    r=i;
                    l1=l;
                }
                sum-=queue.poll();
                l++;
            }
        }
        l1++;
        System.out.println(l1+" "+r);
    }




    public static void main2(String[] args) {
Scanner scanner=new Scanner(System.in);
int n=scanner.nextInt();
int x=scanner.nextInt();
int []arr=new int[n];
int l=-1;
int r=-1;

        for (int i = 0; i <n ; i++) {
            arr[i]=scanner.nextInt();
        }
int sum=0;
        int minlen=Integer.MAX_VALUE;
        for (int left = 0,right=0; right <n ; right++) {
            sum+=arr[right];
          while (sum>=x){
              if(right-left+1<minlen){
                  minlen=right-left+1;
                  l=left;
                  r=right;
              }
              sum-=arr[left++];
          }
        }
        l++;
        r++;
        System.out.println(l+" "+r);
    }


    public static void main1(String[] args) {
        Scanner scanner=new Scanner(System.in);
        String str=scanner.nextLine();
        String s=str.toUpperCase();
        int len=0;
        int f=1;
        for (int i = 0; i <s.length() ; i++) {
           if (f==1){
               System.out.print(s.charAt(i));
               f=0;
           }
            if(s.charAt(i)==' '){
                f=1;
            }
        }
    }
}
